package com.weds.test_driver;

import com.weds.common_service.ArchiveDto;
import com.weds.domain_service.domain.UserDo;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.factory.Mappers;

/**
 * @Description dto -> do
 * @Author lihw
 * @Date 2024/2/26 17:39
 */
@Mapper
public interface UserMapper {

    UserMapper INSTANCE = Mappers.getMapper(UserMapper.class);

    @Mapping(target = "id", source = "userId")
    @Mapping(target = "name", source = "userName")
    @Mapping(target = "hobby", source = "hobby")
    @Mapping(target = "age", source = "age")
    UserDo fromArchiveDto(ArchiveDto archiveDto);
    @Mapping(source = "id", target = "userId")
    @Mapping(source = "name", target = "userName")
     ArchiveDto toArchiveDto(UserDo userDo) ;

}
